Skip to content

Build QNN backend on linux: add CXX platform and qnn_executorch_backend_aot host target#19889

Open
mohankumarkumar wants to merge 1 commit into
mainfrom
export-D105761976
Open

Build QNN backend on linux: add CXX platform and qnn_executorch_backend_aot host target#19889
mohankumarkumar wants to merge 1 commit into
mainfrom
export-D105761976

Conversation

@mohankumarkumar
Copy link
Copy Markdown

Summary:
Make the QNN backend buildable on linux hosts so that AOT / offline
use cases (compilation, validation, host-side testing against the
simulator) can link against the QnnExecuTorchBackend without an
android target.

Two changes:

  1. Add CXX to platforms = [ANDROID] on the QNN backend BUCK
    targets (5 sites across backends/qualcomm/runtime/,
    backends/qualcomm/aot/wrappers/, and the top-level
    backends/qualcomm/targets.bzl). The QNN runtime sources have no
    android-specific code (__ANDROID__, fastrpc, dlopen are not
    referenced), so expanding the platform set is a one-line tag
    change and the ANDROID behavior is unchanged.

  2. Add qnn_executorch_backend_aot in
    backends/qualcomm/targets.bzl. Mirrors the structure of the
    existing qnn_executorch_backend (on-device) but depends on the
    host :runtime target instead of :runtime_android_build. The
    host runtime bundles the QNN offline-compile libraries as a Buck
    resource, so consumers linking the AOT variant get the libs in
    their dlopen search path without manual setup. Registers
    "QnnBackend" via the same link-whole static initializer as the
    on-device variant.

Differential Revision: D105761976

…nd_aot host target

Summary:
Make the QNN backend buildable on linux hosts so that AOT / offline
use cases (compilation, validation, host-side testing against the
simulator) can link against the QnnExecuTorchBackend without an
android target.

Two changes:

1. Add `CXX` to `platforms = [ANDROID]` on the QNN backend BUCK
   targets (5 sites across `backends/qualcomm/runtime/`,
   `backends/qualcomm/aot/wrappers/`, and the top-level
   `backends/qualcomm/targets.bzl`). The QNN runtime sources have no
   android-specific code (`__ANDROID__`, `fastrpc`, `dlopen` are not
   referenced), so expanding the platform set is a one-line tag
   change and the ANDROID behavior is unchanged.

2. Add `qnn_executorch_backend_aot` in
   `backends/qualcomm/targets.bzl`. Mirrors the structure of the
   existing `qnn_executorch_backend` (on-device) but depends on the
   host `:runtime` target instead of `:runtime_android_build`. The
   host runtime bundles the QNN offline-compile libraries as a Buck
   resource, so consumers linking the AOT variant get the libs in
   their dlopen search path without manual setup. Registers
   `"QnnBackend"` via the same link-whole static initializer as the
   on-device variant.

Differential Revision: D105761976
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 29, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19889

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 3 Pending

As of commit f046212 with merge base 10e2eec (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 29, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 29, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: mohankumarkumar / name: Mohan Kumar Kumar (f046212)

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 29, 2026

@mohankumarkumar has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105761976.

@mohankumarkumar
Copy link
Copy Markdown
Author

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot Bot added the release notes: none Do not include this in the release notes label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant